import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
// https://vite.dev/config/
export default defineConfig({
    plugins: [react()],
    resolve: {
        alias: {
            "@": path.resolve(__dirname, "./src"), // 确保别名配置
        },
    },
    server: {
        host: "0.0.0.0",
        port: 3001,
        proxy: {
            "/api": {
                // target: "http://192.168.1.15",
                target: "https://chindao.io",
                changeOrigin: true,
                // rewrite: (path) => path.replace(/^\/api/, ""),
            },
            "/rpc": {
                target: "https://xai-chain.net/rpc",
                changeOrigin: true,
                rewrite: function (path) { return path.replace(/^\/api/, ""); },
            },
        },
    },
});
